<%@ page import="com.raysdata.smartcity.dto.User" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">

    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta http-equiv="Cache-Control" content="no-store" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <title>沈阳情报合成研判平台</title>
    <link rel="shortcut icon" href="${ctx}/static/images/logo_ico01.ico">

    <link href="${ctx}/static/js/iCheck/skins/minimal/minimal.css" rel="stylesheet">
    <link href="${ctx}/static/js/iCheck/skins/square/square.css" rel="stylesheet">
    <link href="${ctx}/static/js/iCheck/skins/square/red.css" rel="stylesheet">
    <link href="${ctx}/static/js/iCheck/skins/square/blue.css" rel="stylesheet">
    <link href="${ctx}/static/css/clndr.css" rel="stylesheet">
    <link href="${ctx}/static/js/morris-chart/morris.css" rel="stylesheet">
    <link href="${ctx}/static/css/style.css" rel="stylesheet">
    <link href="${ctx}/static/css/bootstrap-table.min.css"  rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/style-responsive.css" rel="stylesheet">
    <link href="${ctx}/static/js/bootstrap-datetimepicker/css/datetimepicker-custom.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/metroStyle.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/fonts/iconfont.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/static/css/rzcrm.css" rel="stylesheet" type="text/css"/>


    <style>
        @font-face {
            font-family: "iconfont";
            src: url('${ctx}/static/css/iconfont.eot?t=1476716734');
            src: url('${ctx}/static/css/iconfont.eot?t=1476716734#iefix') format('embedded-opentype'), /* IE6-IE8 */
            url('${ctx}/static/css/iconfont.woff?t=1476716734') format('woff'), /* chrome, firefox */
            url('${ctx}/static/css/iconfont.ttf?t=1476716734') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
            url('${ctx}/static/css/iconfont.svg?t=1476716734#iconfont') format('svg');/* IE9*/
            /* iOS 4.1- */
        }

        .edui-default{
            color:#666;
            text-shadow: none !important;
        }
        .iconfont {
            font-family: "iconfont" !important;
            font-size: 16px;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -webkit-text-stroke-width: 0.2px;
            -moz-osx-font-smoothing: grayscale;
        }
        .icon-tishi:before {
            content: "\e614";
        }
        .icon-guanbi:before {
            content: "\e604";
        }
        .icon-tuxiangchulileiiconshuchu01:before {
            content: "\e653";
        }
        .icon-cuowu:before {
            content: "\e622";
        }
        #logogan{
            height: 50px;
            width: 54px;
            display: inline-block;
            margin-top: -10px;
            margin-left: 14px;
        }
    </style>
    <style>

    </style>
    <script src="${ctx}/static/js/jquery.min.js"></script>
    <script src="${ctx}/static/js/vue.js"></script>
</head>
<body  class="sticky-header">
<section>
    <!-- 左树菜单-->

    <div id="jdt">
        <div></div>
    </div>
    <div class="left-side sticky-left-side" style="overflow: hidden;">
        <!--logo-->
        <!--logo end-->

        <div class="left-side-inner">
            <!--重要高度-->
            <div style="height: 10px;"></div>
            <!--重要高度-->

            <!--菜单列表-->
            <ul class="nav nav-pills nav-stacked custom-nav" id="leftTree">
                <li><a href="javascript:backMainFun();"><i class="fa fa-home"></i> <span>首页</span></a></li>
                <script>
                    $.getJSON('${ctx}/menu/getMenu', function(data){
                        var menu = data.rows;
                        for(var i=0;i<menu.length;i++){
                            if(menu[i].level==1) {
                                if (menu[i].url) {
                                    $('#leftTree').append('<li id="menu1'+menu[i].menu_id+'"><a href="javascript:loadFun(\'' + menu[i].url + '\');"><i class="'+menu[i].menu_icon+'"></i>&nbsp;&nbsp;&nbsp;<span>' + menu[i].name + '</span></a></li>');
                                } else {
                                    $('#leftTree').append('<li id="menu1'+menu[i].menu_id+'" class="menu-list"><a href="javascript:;"><i class="'+menu[i].menu_icon+'"></i>&nbsp;&nbsp;&nbsp;<span>' + menu[i].name + '</span></a><ul class="sub-menu-list"></ul></li>');
                                }
                            }
                        }
                        for(var i=0;i<menu.length;i++){
                            if(menu[i].level==2) {
                                $('#menu1'+menu[i].parent_id).find('.sub-menu-list').append('<li><a href="javascript:loadFun(\'' + menu[i].url + '\');"> '+menu[i].name+'</a></li>');
                            }
                        }

                        //  class add mouse hover
                        jQuery('.custom-nav > li').hover(function(){
                            jQuery(this).addClass('nav-hover');
                        }, function(){
                            jQuery(this).removeClass('nav-hover');
                        });


                        // Menu Toggle

                        jQuery('.menu-list > a').click(function() {
                            var parent = jQuery(this).parent();
                            var sub = parent.find('> ul');

                            if(!jQuery('body').hasClass('left-side-collapsed')) {
                                if(sub.is(':visible')) {
                                    sub.slideUp(200, function(){
                                        parent.removeClass('nav-active');
//                                            jQuery('.main-content').css({height: ''});
                                        mainContentHeightAdjust();
                                    });
                                } else {
                                    visibleSubMenuClose();
                                    parent.addClass('nav-active');
                                    sub.slideDown(200, function(){
//                                        mainContentHeightAdjust();
                                    });
                                }
                            }
                            return false;
                        });
                        function visibleSubMenuClose() {
                            jQuery('.menu-list').each(function() {
                                var t = jQuery(this);
                                if(t.hasClass('nav-active')) {
                                    t.find('> ul').slideUp(200, function(){
                                        t.removeClass('nav-active');
                                    });
                                }
                            });
                        }
                        function mainContentHeightAdjust() {
                            // Adjust main content height
                            var docHeight = jQuery(document).height();
//                                if(docHeight > jQuery('.main-content').height())
//                                    jQuery('.main-content').height(docHeight);
                        }

                        $('#leftTree').find('li a').click(function(){
                            $('#leftTree').find('li a').removeClass('active');
                            $(this).addClass('active');
                        });
                    });
                </script>
            </ul>
            <!--菜单列表 end-->

        </div>
    </div>
    <!-- 左树菜单 end-->

    <!-- 内容区-->
    <div class="main-content" >
        <!-- 顶部条 start-->
        <div class="header-section">
            <!--切换左树宽窄-->
            <div class="logoBox" style="margin-left: 18px;">
                <img id="logogan" src="${ctx}/static/images/logogan01.png" alt="">
                <a href="javascript:backMainFun();">
                    <img src="${ctx}/static/images/logo-yp.png" alt="">
                </a>
            </div>
            <div id="toggleLeft">
                <i class="fa fa-list"></i>
            </div>
            <!--切换左树宽窄 end-->
            <div class="menu-right">
                <ul class="notification-menu">

                    <li style="line-height: 70px;margin-right: 10px;">
                        <i class="glyphicon glyphicon-user"></i>

                        <%
                            User M = (User)session.getAttribute("LoginUser"); //从session里把a拿出来，并赋值给M
                        %>
                        <%= M.getUser_name()%>
                        ，您好
                    </li>
                    <li>
                    <a href="javascript:loadFun('/user/toUpdatePwd');" class="btn btn-default dropdown-toggle">
                    <i class="fa fa-unlock-alt"></i>  修改密码
                    </a>
                    </li>
                    <li>
                        <a href="${ctx}/account/loginOut" class="btn btn-default dropdown-toggle" >
                            <i class="fa fa-power-off"></i> 退出
                        </a>
                    </li>

                </ul>
            </div>

        </div>
        <!-- 顶部条 end-->



        <div class="container-fluid main-container">

            <!--载入区域div-->
            <div id="main-box">

            </div>
            <!--载入区域div-->
            <%--<div style="height: 50px;"></div>--%>
        </div>
        <%--<footer style="z-index:10;">--%>
        <%--北京睿至大数据有限公司 京ICP备16000739号--%>
        <%--</footer>--%>
        <!--footer section end-->


    </div>
    <!-- 内容区 end-->
</section>

<div id="logding-box">
    <div class="dailong">
        <i class="fa fa-spinner"></i> 加载中
    </div>
</div>

<div id="zAlertBox" class=" top-hide">
    <i class="iconfont">&#xe614;</i>
    <span></span>
</div>

<div class="zAlert">
    <div class="daoling top-hide">
        <div class="head">
            <i class="iconfont">&#xe614;</i>
            <span></span>
            <i class="iconfont close-icon">&#xe622</i>
        </div>
        <div class="body">

        </div>
        <div class="foot">
            <button type="button" class="zAlBtn-ok"><i class="iconfont">&#xe653</i> 确定</button>
        </div>
    </div>
</div>

<div class="zConfirm">
    <div class="daoling top-hide">
        <div class="head">
            <i class="iconfont">&#xe614;</i>
            <span>信息提示</span>
            <i class="iconfont close-icon">&#xe622</i>
        </div>
        <div class="body">
            确认删除
        </div>
        <div class="foot">
            <button type="button" class="zConBtn-ok"><i class="iconfont">&#xe653</i> 确定</button>
            <button type="button" class="zConBtn-close"><i class="iconfont">&#xe604</i> 关闭</button>
        </div>
    </div>
</div>

<script src="${ctx}/static/js/jquery.uploadify.js"></script>
<script src="${ctx}/static/js/axios.min.js"></script>
<script src="${ctx}/static/js/bootstrap.min.js"></script>
<script src="${ctx}/static/js/bootstrap-table.min.js"></script>
<script src="${ctx}/static/js/bootstrap-table-zh-CN.min.js"></script>
<script src="${ctx}/static/js/jquery.nicescroll.js"></script>
<script src="${ctx}/static/js/iCheck/jquery.icheck.js"></script>
<script src="${ctx}/static/js/icheck-init.js"></script>
<script src="${ctx}/static/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
<script src="${ctx}/static/js/jquery.ztree.all.min.js"></script>
<script src="${ctx}/static/js/fileupload/vendor/jquery.ui.widget.js"></script>
<script src="${ctx}/static/js/fileupload/tmpl.min.js"></script>
<script src="${ctx}/static/js/fileupload/jquery.iframe-transport.js"></script>
<script src="${ctx}/static/js/fileupload/jquery.fileupload.js"></script>
<script src="${ctx}/static/js/fileupload/jquery.fileupload-process.js"></script>
<script src="${ctx}/static/js/fileupload/jquery.fileupload-ui.js"></script>
<script src="${ctx}/static/js/echarts.min.js"></script>
<script src="${ctx}/static/js/ios-switch/switchery.js"></script>
<script type="text/javascript" src="${ctx}/static/scripts/js/module.js"></script>
<script type="text/javascript" src="${ctx}/static/scripts/js/uploader.js"></script>
<script type="text/javascript" src="${ctx}/static/scripts/js/simditor.js"></script>

<!-- 百度地图 -->
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=l98VKPgRTtOzvMGnQWuiV3IGnOVaaNiN"></script>

<script>
    jQuery.browser={};(function(){jQuery.browser.msie=false; jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){ jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
</script>
<script src="${ctx}/static/js/TreeGrid2.js"></script>

<%--<script src="${ctx}/static/js/scripts.js"></script>--%>

<script type="text/javascript">

    //定时器
    var timergetFj;
    var timergetJudgmentUsers;
    //组织树数据
   /* var _zNodes;
    $.ajax({
        url: "${ctx}/org/getOrgTree",
        type: 'post',
        async:false,
        success: function (data) {
            _zNodes=data;
        }
    });*/
    //组织树数据

    $("#toggleLeft").click(function () {

        if($('.left-side.sticky-left-side').width()>0){
            $("#main-box").css('paddingLeft','0');
            $('.left-side.sticky-left-side').width(0);
        }else{
            $("#main-box").css('paddingLeft','200px');
            $('.left-side.sticky-left-side').width('200px');
        }
    });


    window.onbeforeunload = function (event) {
        var aaa = window.location.href;
        aaa = aaa.split('#');
        var zUrl = aaa[1];
        document.cookie="zUrl=#"+zUrl;
    };
    window.onload=function () {

        var zUrl = document.cookie;

        if(zUrl){
            zUrl = zUrl.split('#')[1];

            if(zUrl == '/account/toMainInit'){
                backMainFun();
            }else{
                loadFun(zUrl);
            }

        }

    };

    var ws = null;

    //载入页面函数
    var mainBox = $('#main-box');
    function loadFun(a){
        if(ws){
            ws.close();
            ws = null;
            clearInterval(timergetFj);
            clearInterval(timergetJudgmentUsers);
        }


        lodingShow();
        jdtShow();
        mainBox.load('${ctx}'+a,function(){
            setTimeout(function(){
                lodingHide();
            },300);
            setTimeout(function () {
                jdtHide();
            },200);
        });

        history.pushState(a,'','#'+a);

    }
    //默认载入首页

    function backMainFun(){
        loadFun('/account/toMainInit');
    };



    function jdtShow(){
        $('#jdt').css('opacity','1');
        $('#jdt div').css('width','70%');
    }
    function jdtHide(){
        $('#jdt div').css('width','100%');
        setTimeout(function () {
            $('#jdt').css('opacity','0');
            $('#jdt div').css('width','0');
        },300);
    }

    window.addEventListener('popstate',function(event){
        if(ws){
            ws.close();
            ws = null;
            clearInterval(timergetFj);
            clearInterval(timergetJudgmentUsers);
        }

        var a = event.state;

        if(a == null){
            loadFun('/account/toMainInit');
            return false;
        }else{
            lodingShow();
            jdtShow();
            mainBox.load('${ctx}'+a,function(){
                setTimeout(function(){
                    lodingHide()
                },200);
                setTimeout(function(){
                    jdtHide();
                },200);
            });

        }
    });
    //载入页面函数

    //loding函数
    $('#logding-box').height($(window).height());

    function lodingShow(){
        $('#logding-box').show();
    }
    function lodingHide(){
        $('#logding-box').hide();
    }
    //loding函数


    //弹窗函数和confirm函数

    $(".zAlert").height($(window).height());
    $(".zConfirm").height($(window).height());

    $(window).keyup(function(event){
        if(event.keyCode=='13' || event.keyCode=='27'){
            if(zAlertValue){
                zAlertHide()
            }
        }
    })

    var zAlertValue=false;

    $(".zAlert .close-icon").on('click',function(){
        zAlertHide();
    });
    $('.zAlert .zAlBtn-ok').on('click',function(){
        zAlertHide();
    });
    function zAlertHide(){
        $(".zAlert").find('.daoling').addClass('top-hide');
        setTimeout(function(){
            $(".zAlert").fadeOut(100);
        })
        $('button').blur();
        zAlertValue=false;
        return zAlertValue;
    };
    function zAlertShow(){
        $(".zAlert").fadeIn(100);
        setTimeout(function(){
            $(".zAlert").find('.daoling').removeClass('top-hide');
        })
        zAlertValue=true;
        return zAlertValue;
    };

    //          zAlert1
    //        function zAlert(a,b){
    //            $(".zAlert .body").text(a);
    //            if(b){
    //                $(".zAlert .head span").text(b);
    //            }else{
    //                $(".zAlert .head span").text('信息提示');
    //            }
    //            zAlertShow();
    //        };


    //        zAlert2
    function zAlert(a){
        if($('#zAlertBox').hasClass('top-hide')){
            $('#zAlertBox span').text(a);
            $('#zAlertBox').removeClass('top-hide');

            setTimeout(function () {
                $('#zAlertBox').addClass('top-hide');
            },2500);
        }
    }





    $('.zAlert').on('click',function(){
        zAlertHide();
    });
    $('.zAlert .daoling').on('click',function(e){
        e.stopPropagation();
    });


    $(".zConfirm .close-icon").on('click',function(){
        zConfirmHide();
    });
    $(".zConfirm .zConBtn-close").on('click',function(){
        zConfirmHide();
    });
    function zConfirmHide(){
        $(".zConfirm").find('.daoling').addClass('top-hide');
        setTimeout(function(){
            $(".zConfirm").fadeOut(100);
        })
        return false;
    };
    function zConfirmShow(){
        $(".zConfirm").fadeIn(100);
        setTimeout(function(){
            $(".zConfirm").find('.daoling').removeClass('top-hide');
        })
    };
    $('.zConfirm').on('click',function(){
        zConfirmHide();
    });
    $('.zConfirm .daoling').on('click',function(e){
        e.stopPropagation();
    });

    function zConfirm(a){
        $(".zConfirm .body").text(a);
        zConfirmShow();
        confirmOk=$('.zConfirm .zConBtn-ok');
        confirmOk.unbind();
        return confirmOk;
    };
    //弹窗函数和confirm函数



    //        zConfirm('是否删除？');
    //        confirmOk.click(function(){
    //            zConfirmHide();
    //            setTimeout(function(){
    //                zAlert('删除成功')
    //            },100);
    //        });


    //禁止浏览器按delete键时后退事件
    function banBackSpace(e){
        var ev = e || window.event;//获取event对象
        var obj = ev.target || ev.srcElement;//获取事件源

        var t = obj.type || obj.getAttribute('type');//获取事件源类型

        //获取作为判断条件的事件类型
        var vReadOnly = obj.getAttribute('readonly');
        var vEnabled = obj.getAttribute('enabled');
        //处理null值情况
        vReadOnly = (vReadOnly == null) ? false : vReadOnly;
        vEnabled = (vEnabled == null) ? true : vEnabled;

        //当敲Backspace键时，事件源类型为密码或单行、多行文本的，
        //并且readonly属性为true或enabled属性为false的，则退格键失效
        var flag1=(ev.keyCode == 8 && (t=="password" || t=="text" || t=="textarea")
        && (vReadOnly==true || vEnabled!=true))?true:false;

        //当敲Backspace键时，事件源类型非密码或单行、多行文本的，则退格键失效
        var flag2=(ev.keyCode == 8 && t != "password" && t != "text" && t != "textarea")
                ?true:false;

        //判断
        if(flag2){
            return false;
        }
        if(flag1){
            return false;
        }
    }

    //禁止后退键 作用于Firefox、Opera
    document.onkeypress=banBackSpace;
    //禁止后退键 作用于IE、Chrome
    document.onkeydown=banBackSpace;

    //禁止浏览器按delete键时后退事件 end


    //返回上层页面函数
    function backFun(a) {
        history.go(-1);
    }
</script>

</body>
</html>
